package com.xuan.email.sendEmail;

import com.xuan.temper.entity.EchartsEntity;
import com.xuan.temper.entity.RespBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @创建人： king xuan
 * @创建时间：2020/9/25
 * @描述：
 */
@RestController
@RequestMapping(value = "/email")
public class SendEmailController {

    /**
     * 注入发送邮件的接口
     */
    @Autowired
    private IMailService mailService;

    @RequestMapping("/sendEmail")
    public RespBean sendEmail(){
        Boolean aBoolean = null;
        try {
            aBoolean = mailService.sendSimpleMail("1904931470@qq.com", "主题：你好普通邮件", "内容：第一封邮件");
        } catch (Exception e) {
            return new RespBean("200",e,"发送失败");
        }
        return new RespBean("200",aBoolean,"发送成功");
    }

}
